'use strict';

function double_to_one(collection) {
  let result=new Array();
  let arr=new Array();
  for(let i=0;i<collection.length;i++){
    if(collection[i] instanceof Array==true){
      arr=arr.concat(collection[i]);     
    }
    else{
      arr.push(collection[i]);
    }
  }
  for(let n=0;n<arr.length;n++){
    if(result.indexOf(arr[n])==-1){
      result.push(arr[n]);
    }
  }
  return result;
}

module.exports = double_to_one;
